/*
 * @Author: Await
 * @Date: 2024-12-26 11:22:55
 * @LastEditors: Await
 * @LastEditTime: 2024-12-27 09:25:19
 * @Description: 请填写简介
 */
import { request } from '../request';

export const mediaApi = {
  /**
   * 获取媒体列表
   * @param params 查询参数
   */
  getMediaList(params: Api.Media.MediaListParams) {
    return request<Api.Media.PaginatedResponse>({
      url: 'Media/MediaList',
      method: 'GET',
      params: {
        ...params,
        sortOrder: params.sortOrder === 'asc'
      }
    });
  }
};

/** 获取图片数据 */
export function fetchImageData(path: string) {
  return request<Blob, 'blob'>({
    url: `/Media/MediaImageDataBasedPath`,
    params: {
      path
    },
    responseType: 'blob'
  });
}

/** 获取每一季详细数据 */
export function fetchMediaCollectionData(id: string) {
  return request<Api.Media.MediaCollectionItemList[]>({
    url: `/Media/MediaCollectionList/${id}`,
    method: 'GET'
  });
}
